package initialize

import (
	"api/global"
	"fmt"
	"google.golang.org/grpc"
	pb "rpc/api/video"
)

func InitRpc() {
	// 1.连接
	conn, err := grpc.Dial("127.0.0.1:8080", grpc.WithInsecure())
	if err != nil {
		fmt.Printf("连接异常： %s\n", err)
		return
	}
	//defer conn.Close()
	// 2. 实例化gRPC客户端
	global.UserServiceClient = pb.NewVideoServiceClient(conn)
}
